<template>
    <view>
        <!-- mine/pages/refundDetails/refundDetails.wxml -->
        <view class="detail2">
            <view class="title">
                <image src="https://oos-cn.ctyunapi.cn/front-end/static/mine/images/refund_wx.png" class="img"></image>
            </view>
            <view class="payType">微信充值</view>
            <view class="money">+{{recordDetail.income}}</view>
            <view class="info">
                <view class="label">充值状态</view>
                <view class="value">{{status[Number(recordDetail.rechargeStatus) - 1]}}</view>
            </view>
            <view class="info">
                <view class="label">支付流水号</view>
                <view class="value"><text class="code">{{recordDetail.serialNumber || '--'}}</text>  |<text :style="{color: objColor2.textColor,marginLeft: '10rpx'}" @tap="copyText" :data-text="recordDetail.serialNumber">复制</text></view>
            </view>
            <view class="info">
                <view class="label">充值方式</view>
                <view class="value">{{recordDetail.rechargeTypeStr}}</view>
            </view>
            <view class="info">
                <view class="label">充值渠道</view>
                    <view class="value">{{recordDetail.accountFlowDescribe}}</view>
            </view>
            <view class="info">
                <view class="label">充值时间</view>
                <view class="value">{{recordDetail.incomeTime}}</view>
            </view>
        </view>
        <!--<view class="doubt">-->
            <!--如有疑问请查看<text @tap="showExplainFun">退款说明</text>或直接<text @tap="showCustomerFun">联系客服</text>-->
        <!--</view>-->
    </view>
</template>

<script>
	'use strict';

	// exports.__esModule = true; // mine/pages/refundDetails/refundDetails.ts

	var https_1 = require('./../../../api/https.js');
	export default {
		components: {
		},
		data() {
			return {
				showExplain: false,
				showCustomer: false,
				id: 0,
				recordDetail: {},
        status:['充值成功','已处理','已关闭']
			};
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function (options) {
			if (options.id) {
				this.id = options.id
				this.getAccountFlowDetails();
			}
		},
		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady: function () {},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function () {

		},
		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide: function () {},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload: function () {},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh: function () {},
		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom: function () {},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function () {},
		methods: {
			getAccountFlowDetails: function () {
				var that = this;
				https_1.getAccountFlowDetails({id: this.id})
					.then(function (res) {
						if (res.code == 0) {
							var data = res.data;
							data.income = (data.income / 100).toFixed(2);
							that.recordDetail = data
						}
					});
			},
			copyText(e) {
				console.log(e)
				uni.setClipboardData({
					data: e.currentTarget.dataset.text
				});
			},

			// 退款说明
			showExplainFun: function () {
				this.showExplain= true
			},

			onCloseExplain: function () {
				this.showExplain= false
			},

			showCustomerFun: function () {
				this.showCustomer= true
			},

			onCloseCustomer: function () {
				this.showCustomer= false
			},

			//客服电话
			call: function () {
				this.showCustomer = false
				uni.makePhoneCall({
					phoneNumber: this.recordDetail.customerTelephone
				});
			}
		}
	};
</script>
<style lang="less" scoped>
    @import url('./rechargeInfo.less');
    /* mine/pages/refundDetails/refundDetails.wxss */
</style>
